 <template>
   <el-card shadow="always" class="box-card">
      <div class="card-name">
        <div class="name width2">退回订单</div>
      </div>
      <div class="content-con">
        <el-form :model="form" ref="form">

        </el-form>

        <div class="bank-form">
          <div class="form-item">
            <el-table
              :data="tableData.slice((currentPage-1)*pagesize,currentPage*pagesize)"
              class="table"
              stripe border
              :header-cell-style="{background:'#f3f3f3'}"
              ><!--:data="用于存放请求数据回来的数组" -->
              <el-table-column prop="bill_no" label="流水单号" width="180">
              </el-table-column>
              <el-table-column prop="uid" label="商户ID/昵称" width="120">
              </el-table-column>
              <el-table-column prop="submoney" label="变更前金额(元)" width="120">
              </el-table-column>
              <el-table-column prop="number" label="变更金额(元)" width="120">
              </el-table-column>
              <el-table-column prop="balance" label="变更后余额(元)" width="120">
              </el-table-column>
              <el-table-column prop="billType" label="业务类型" width="140">
              </el-table-column>
              <el-table-column prop="add_time" label="时间" width="260">
              </el-table-column>
              <el-table-column label="操作" width="160">
                <template slot-scope="scope">
                  <el-button type="text" @click="handleEdit(scope.row)">
                    <i class="el-icon-edit"></i>查看
                  </el-button>
                </template>
              </el-table-column>
            </el-table>
          </div>
          <!-- 分页-页码 -->
          <div class="page">
            <el-pagination
              @size-change="handleSizeChange"
              @current-change="handleCurrentChange"
              :current-page="currentPage"
              :page-sizes="[5, 10, 15, 20]"
              :page-size="pagesize"
              layout="total, sizes, prev, pager, next, jumper"
              :total="tableData.length">
            </el-pagination>
          </div>
        </div>
      </div>
   </el-card>

 </template>
<script>

export default {
  data () {
    return {
      currentPage: 1, //当前页码
      pagesize: 5,    //每页的数据条数
      tableData: [], //表格数据
      form: {
      }
    }
  },

  methods: {
    //搜索
    search() {
      this.$refs['form'].validate((valid) => {
        if (valid) {
          console.log(this.form)
          this.$message.success('成功!');
        } else {
          console.log('error submit!!');
          this.$message.error('失败!');
          return false;
        }
      });
    },

    //编辑操作
    handleEdit(row){
    },

    //每页条数改变时触发事件,选择一页显示多少行
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
      this.currentPage = 1;
      this.pagesize = val;
    },
    // 当前页改变时触发 跳转其他页
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
      this.currentPage = val;
    }
  }
}
</script>
<style lang="scss">

</style>
